package edu.hawaii.ics414.blackjack.card;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

/**
 * Tests the GameDeck class.
 * 
 * @author Branden Ogata
 *
 */

public class TestGameDeck
{
  /**
   * Creates and tests GameDeck instances.
   * 
   */
  
  @Test
  public void test()
  {
    GameDeck deck = new GameDeck(1);
    
    // A single deck should have 52 cards
    assertEquals("Single deck should have 52 cards", 52, deck.getSize());
    
    Card first = deck.peek();
    assertEquals("First card drawn should equal the first card peeked at", first, deck.draw());
    assertEquals("After drawing once, deck should have 51 cards", 51, deck.getSize());
    
    // Comparison of decks
    deck = new GameDeck(1);
    GameDeck vegasDeck = new GameDeck(6);
    assertTrue("vegasDeck equality", vegasDeck.equals(vegasDeck));
    assertFalse("vegasDeck inequality", vegasDeck.equals(deck));
    assertEquals("vegasDeck hashcode equality", vegasDeck.hashCode(), vegasDeck.hashCode());
  }
}
